home *** CD-ROM | disk | FTP | other *** search
- Path: hsun13.hou281.chevron.com!gacwra
- From: gacwra@hsun13.hou281.chevron.com (C.W.Racer)
- Newsgroups: comp.lang.c
- Subject: Re: Infrequent use of do while, C Idioms
- Date: 2 Jan 1996 21:08:08 GMT
- Organization: Chevron
- Distribution: world
- Message-ID: <1996Jan2.150509@hsun13.hou281.chevron.com>
- References: <49slsq$10l@panix2.panix.com> <4a5pk6$pvd@ixnews6.ix.netcom.com> <1995Dec7.154222.9354@lamont.ldgo.columbia.edu>
- NNTP-Posting-Host: hsun13.hou281.chevron.com
-
- In article <1995Dec7.154222.9354@lamont.ldgo.columbia.edu>, mike@armchair.mb.ca (Mike Forster) writes:
- |> cjds@ix.netcom.com (Bill Horger) wrote:
- |>
- |> [snipped]
- |>
- |> >
- |> >| So, anyhow, I was thinking and I realized that I have never ever seen
- |> >| a
- |> >| do {
- |> >| } while (condition)
- |> >
- ---------------------------------stuff deleted -----------------------
-
- The issue here is do you want the loop 'top-tested' or 'bottom-tested'?
- Most c programmers prefer (seems to me) the top-tested loop. Once in a
- while I'll find the other one seems to fit better.
-
- PL/1 DO loops allow both (using the 'while' and 'until' for top and
- bottom tested). I actually used that once but only because it intrigued
- me.
- --
- | Chick Racer Chevron Petroleum Technology Co. |
- | (713) 596-2430 P.O. Box 42832 |
- | gacwra@chevron.com Houston, Tx 77242-2832 |
- | 4119 Hayes Rd. |
-